package cn.sykj.car.entity;

import cn.sykj.car.utils.DiffEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 中国地区信息
 * </p>
 *
 * @author yixu
 * @since 2020-07-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = false)
@ApiModel(value="Region对象", description="中国地区信息")
public class Region extends Model<Region> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "代码")
    @DiffEntity(action = "区域编码变化")
    private String code;

    @ApiModelProperty(value = "名称")
    @DiffEntity(action = "区域名称变化")
    private String name;

    @ApiModelProperty(value = "简称")
    @DiffEntity(action = "区域简称变化")
    private String shotName;

    @ApiModelProperty(value = "上级代码")
    @DiffEntity(action = "上级编码变化")
    private String pCode;

    @ApiModelProperty(value = "经度")
    @DiffEntity(action = "经度变化")
    private String lng;

    @ApiModelProperty(value = "纬度")
    @DiffEntity(action = "纬度变化")
    private String lat;

    @ApiModelProperty(value = "排序")
    @DiffEntity(action = "排序变化")
    private Integer seq;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    @DiffEntity(action = "备注变化")
    private String remarks;

    @ApiModelProperty(value = "状态")
    @TableLogic
    private Integer delFlag;

    @ApiModelProperty(value = "租户ID")
    private String tenentCode;

    @ApiModelProperty(value = "级别")
    @DiffEntity(action = "行政级别变化")
    private String level;

    @ApiModelProperty(value = "所属大区")
    @DiffEntity(action = "所属大区变化")
    private String region;


    public static final String ID = "id";

    public static final String CODE = "code";

    public static final String NAME = "name";

    public static final String SHOT_NAME = "shot_name";

    public static final String P_CODE = "p_code";

    public static final String LNG = "lng";

    public static final String LAT = "lat";

    public static final String SEQ = "seq";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String REMARKS = "remarks";

    public static final String DEL_FLAG = "del_flag";

    public static final String TENENT_CODE = "tenent_code";

    public static final String LEVEL = "level";

    public static final String REGION = "region";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
